Integrand size = 17, antiderivative size = 130 \[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\frac {1}{4} (5+2 x) \sqrt {x+x^2}+\sqrt {1+\sqrt {2}} \arctan \left (\frac {1+\sqrt {2}-x}{\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {x+x^2}}\right )-\sqrt {-1+\sqrt {2}} \text {arctanh}\left (\frac {1-\sqrt {2}-x}{\sqrt {2 \left (-1+\sqrt {2}\right )} \sqrt {x+x^2}}\right )-\frac {5}{4} \text {arctanh}\left (\frac {x}{\sqrt {x+x^2}}\right ) \]
[Out]
Time = 0.11 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.529, Rules used = {992, 1092, 634, 212, 12, 1050, 1044, 213, 209} \[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\sqrt {1+\sqrt {2}} \arctan \left (\frac {-x+\sqrt {2}+1}{\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {x^2+x}}\right )-\sqrt {\sqrt {2}-1} \text {arctanh}\left (\frac {-x-\sqrt {2}+1}{\sqrt {2 \left (\sqrt {2}-1\right )} \sqrt {x^2+x}}\right )-\frac {5}{4} \text {arctanh}\left (\frac {x}{\sqrt {x^2+x}}\right )+\frac {1}{4} \sqrt {x^2+x} (2 x+5) \]
[In]
[Out]
Rule 12
Rule 209
Rule 212
Rule 213
Rule 634
Rule 992
Rule 1044
Rule 1050
Rule 1092
Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} (5+2 x) \sqrt {x+x^2}-\frac {1}{2} \int \frac {\frac {5}{4}+4 x+\frac {5 x^2}{4}}{\left (1+x^2\right ) \sqrt {x+x^2}} \, dx \\ & = \frac {1}{4} (5+2 x) \sqrt {x+x^2}-\frac {1}{2} \int \frac {4 x}{\left (1+x^2\right ) \sqrt {x+x^2}} \, dx-\frac {5}{8} \int \frac {1}{\sqrt {x+x^2}} \, dx \\ & = \frac {1}{4} (5+2 x) \sqrt {x+x^2}-\frac {5}{4} \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\frac {x}{\sqrt {x+x^2}}\right )-2 \int \frac {x}{\left (1+x^2\right ) \sqrt {x+x^2}} \, dx \\ & = \frac {1}{4} (5+2 x) \sqrt {x+x^2}-\frac {5}{4} \tanh ^{-1}\left (\frac {x}{\sqrt {x+x^2}}\right )+\frac {\int \frac {-1+\left (-1-\sqrt {2}\right ) x}{\left (1+x^2\right ) \sqrt {x+x^2}} \, dx}{\sqrt {2}}-\frac {\int \frac {-1+\left (-1+\sqrt {2}\right ) x}{\left (1+x^2\right ) \sqrt {x+x^2}} \, dx}{\sqrt {2}} \\ & = \frac {1}{4} (5+2 x) \sqrt {x+x^2}-\frac {5}{4} \tanh ^{-1}\left (\frac {x}{\sqrt {x+x^2}}\right )+\left (-2+\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{2 \left (1-\sqrt {2}\right )+x^2} \, dx,x,\frac {-1+\sqrt {2}+x}{\sqrt {x+x^2}}\right )-\left (2+\sqrt {2}\right ) \text {Subst}\left (\int \frac {1}{2 \left (1+\sqrt {2}\right )+x^2} \, dx,x,\frac {-1-\sqrt {2}+x}{\sqrt {x+x^2}}\right ) \\ & = \frac {1}{4} (5+2 x) \sqrt {x+x^2}+\sqrt {1+\sqrt {2}} \tan ^{-1}\left (\frac {1+\sqrt {2}-x}{\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {x+x^2}}\right )-\sqrt {-1+\sqrt {2}} \tanh ^{-1}\left (\frac {1-\sqrt {2}-x}{\sqrt {2 \left (-1+\sqrt {2}\right )} \sqrt {x+x^2}}\right )-\frac {5}{4} \tanh ^{-1}\left (\frac {x}{\sqrt {x+x^2}}\right ) \\ \end{align*}
Result contains higher order function than in optimal. Order 9 vs. order 3 in optimal.
Time = 0.11 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.93 \[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\frac {\sqrt {x} \sqrt {1+x} \left (\sqrt {x} \sqrt {1+x} (5+2 x)+5 \log \left (-\sqrt {x}+\sqrt {1+x}\right )+8 \text {RootSum}\left [16+32 \text {$\#$1}+16 \text {$\#$1}^2+\text {$\#$1}^4\&,\frac {\log \left (-2 x+2 \sqrt {x} \sqrt {1+x}+\text {$\#$1}\right ) \text {$\#$1}^2}{8+8 \text {$\#$1}+\text {$\#$1}^3}\&\right ]\right )}{4 \sqrt {x (1+x)}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(266\) vs. \(2(98)=196\).
Time = 4.60 (sec) , antiderivative size = 267, normalized size of antiderivative = 2.05
method | result | size |
pseudoelliptic | \(-\frac {\left (\left (-\frac {\sqrt {2}}{2}+1\right ) \ln \left (\frac {\sqrt {2}\, x -\sqrt {\left (1+x \right ) x}\, \sqrt {2+2 \sqrt {2}}+x +1}{x}\right )+\left (\frac {\sqrt {2}}{2}-1\right ) \ln \left (\frac {\sqrt {2}\, x +\sqrt {\left (1+x \right ) x}\, \sqrt {2+2 \sqrt {2}}+x +1}{x}\right )-\frac {5 \sqrt {-2+2 \sqrt {2}}\, \ln \left (\frac {\sqrt {\left (1+x \right ) x}-x}{x}\right )}{8}+\frac {5 \sqrt {-2+2 \sqrt {2}}\, \ln \left (\frac {x +\sqrt {\left (1+x \right ) x}}{x}\right )}{8}-\frac {\sqrt {-2+2 \sqrt {2}}\, \left (x +\frac {5}{2}\right ) \sqrt {\left (1+x \right ) x}}{2}+\sqrt {2}\, \left (\arctan \left (\frac {\sqrt {2+2 \sqrt {2}}\, x -2 \sqrt {\left (1+x \right ) x}}{x \sqrt {-2+2 \sqrt {2}}}\right )-\arctan \left (\frac {\sqrt {2+2 \sqrt {2}}\, x +2 \sqrt {\left (1+x \right ) x}}{x \sqrt {-2+2 \sqrt {2}}}\right )\right )\right ) x^{2}}{\sqrt {-2+2 \sqrt {2}}\, \left (x +\sqrt {\left (1+x \right ) x}\right )^{2} \left (-\sqrt {\left (1+x \right ) x}+x \right )^{2}}\) | \(267\) |
trager | \(\left (\frac {5}{4}+\frac {x}{2}\right ) \sqrt {x^{2}+x}-\frac {5 \ln \left (1+2 x +2 \sqrt {x^{2}+x}\right )}{8}-\frac {\operatorname {RootOf}\left (\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+\textit {\_Z}^{2}+16\right ) \ln \left (-\frac {3 \operatorname {RootOf}\left (\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+\textit {\_Z}^{2}+16\right ) \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{4} x -3 \operatorname {RootOf}\left (\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+\textit {\_Z}^{2}+16\right ) \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{4}-128 \operatorname {RootOf}\left (\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+\textit {\_Z}^{2}+16\right ) \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2} x -112 \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2} \operatorname {RootOf}\left (\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+\textit {\_Z}^{2}+16\right )+384 \sqrt {x^{2}+x}\, \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}-768 \operatorname {RootOf}\left (\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+\textit {\_Z}^{2}+16\right ) x -512 \operatorname {RootOf}\left (\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+\textit {\_Z}^{2}+16\right )+7168 \sqrt {x^{2}+x}}{x \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}-\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+16 x}\right )}{4}+\frac {\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right ) \ln \left (\frac {3 x \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{5}-3 \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{5}+224 x \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{3}+16 \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{3}+384 \sqrt {x^{2}+x}\, \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}+2048 x \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )+512 \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )-1024 \sqrt {x^{2}+x}}{x \operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}-\operatorname {RootOf}\left (\textit {\_Z}^{4}+16 \textit {\_Z}^{2}+128\right )^{2}-16}\right )}{4}\) | \(475\) |
risch | \(\frac {\left (5+2 x \right ) \left (1+x \right ) x}{4 \sqrt {\left (1+x \right ) x}}-\frac {5 \ln \left (x +\frac {1}{2}+\sqrt {x^{2}+x}\right )}{8}+\frac {\sqrt {\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+4+3 \sqrt {2}}\, \sqrt {2}\, \left (\sqrt {-2+2 \sqrt {2}}\, \arctan \left (\frac {\sqrt {-2+2 \sqrt {2}}\, \sqrt {\left (3 \sqrt {2}-4\right ) \left (-\frac {\left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+12 \sqrt {2}+17\right )}\, \left (\frac {24 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+\frac {17 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\sqrt {2}\right ) \left (-\sqrt {2}-1+x \right ) \left (3 \sqrt {2}-4\right )}{2 \left (-\sqrt {2}+1-x \right ) \left (\frac {\left (-\sqrt {2}-1+x \right )^{4}}{\left (-\sqrt {2}+1-x \right )^{4}}-\frac {34 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+1\right )}\right ) \sqrt {1+\sqrt {2}}\, \sqrt {2}-2 \sqrt {-2+2 \sqrt {2}}\, \arctan \left (\frac {\sqrt {-2+2 \sqrt {2}}\, \sqrt {\left (3 \sqrt {2}-4\right ) \left (-\frac {\left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+12 \sqrt {2}+17\right )}\, \left (\frac {24 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+\frac {17 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\sqrt {2}\right ) \left (-\sqrt {2}-1+x \right ) \left (3 \sqrt {2}-4\right )}{2 \left (-\sqrt {2}+1-x \right ) \left (\frac {\left (-\sqrt {2}-1+x \right )^{4}}{\left (-\sqrt {2}+1-x \right )^{4}}-\frac {34 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+1\right )}\right ) \sqrt {1+\sqrt {2}}-4 \,\operatorname {arctanh}\left (\frac {\sqrt {\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+4+3 \sqrt {2}}}{2 \sqrt {1+\sqrt {2}}}\right ) \sqrt {2}+6 \,\operatorname {arctanh}\left (\frac {\sqrt {\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+4+3 \sqrt {2}}}{2 \sqrt {1+\sqrt {2}}}\right )\right )}{2 \sqrt {-\frac {\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-3 \sqrt {2}-4}{\left (1+\frac {-\sqrt {2}-1+x}{-\sqrt {2}+1-x}\right )^{2}}}\, \left (1+\frac {-\sqrt {2}-1+x}{-\sqrt {2}+1-x}\right ) \left (3 \sqrt {2}-4\right ) \sqrt {1+\sqrt {2}}}\) | \(788\) |
default | \(-\frac {5 \ln \left (x +\frac {1}{2}+\sqrt {x^{2}+x}\right )}{8}+\frac {x \sqrt {x^{2}+x}}{2}+\frac {5 \sqrt {x^{2}+x}}{4}+\frac {\sqrt {\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+4+3 \sqrt {2}}\, \sqrt {2}\, \left (\sqrt {-2+2 \sqrt {2}}\, \arctan \left (\frac {\sqrt {-2+2 \sqrt {2}}\, \sqrt {\left (3 \sqrt {2}-4\right ) \left (-\frac {\left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+12 \sqrt {2}+17\right )}\, \left (\frac {24 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+\frac {17 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\sqrt {2}\right ) \left (-\sqrt {2}-1+x \right ) \left (3 \sqrt {2}-4\right )}{2 \left (-\sqrt {2}+1-x \right ) \left (\frac {\left (-\sqrt {2}-1+x \right )^{4}}{\left (-\sqrt {2}+1-x \right )^{4}}-\frac {34 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+1\right )}\right ) \sqrt {1+\sqrt {2}}\, \sqrt {2}-2 \sqrt {-2+2 \sqrt {2}}\, \arctan \left (\frac {\sqrt {-2+2 \sqrt {2}}\, \sqrt {\left (3 \sqrt {2}-4\right ) \left (-\frac {\left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+12 \sqrt {2}+17\right )}\, \left (\frac {24 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+\frac {17 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\sqrt {2}\right ) \left (-\sqrt {2}-1+x \right ) \left (3 \sqrt {2}-4\right )}{2 \left (-\sqrt {2}+1-x \right ) \left (\frac {\left (-\sqrt {2}-1+x \right )^{4}}{\left (-\sqrt {2}+1-x \right )^{4}}-\frac {34 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+1\right )}\right ) \sqrt {1+\sqrt {2}}-4 \,\operatorname {arctanh}\left (\frac {\sqrt {\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+4+3 \sqrt {2}}}{2 \sqrt {1+\sqrt {2}}}\right ) \sqrt {2}+6 \,\operatorname {arctanh}\left (\frac {\sqrt {\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}+4+3 \sqrt {2}}}{2 \sqrt {1+\sqrt {2}}}\right )\right )}{2 \sqrt {-\frac {\frac {3 \sqrt {2}\, \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-\frac {4 \left (-\sqrt {2}-1+x \right )^{2}}{\left (-\sqrt {2}+1-x \right )^{2}}-3 \sqrt {2}-4}{\left (1+\frac {-\sqrt {2}-1+x}{-\sqrt {2}+1-x}\right )^{2}}}\, \left (1+\frac {-\sqrt {2}-1+x}{-\sqrt {2}+1-x}\right ) \left (3 \sqrt {2}-4\right ) \sqrt {1+\sqrt {2}}}\) | \(789\) |
[In]
[Out]
Result contains complex when optimal does not.
Time = 0.33 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.02 \[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\frac {1}{4} \, \sqrt {x^{2} + x} {\left (2 \, x + 5\right )} - \frac {1}{2} \, \sqrt {2 i - 2} \log \left (-2 \, x + \left (i + 1\right ) \, \sqrt {2 i - 2} + 2 \, \sqrt {x^{2} + x} - 2 i\right ) + \frac {1}{2} \, \sqrt {2 i - 2} \log \left (-2 \, x - \left (i + 1\right ) \, \sqrt {2 i - 2} + 2 \, \sqrt {x^{2} + x} - 2 i\right ) - \frac {1}{2} \, \sqrt {-2 i - 2} \log \left (-2 \, x - \left (i - 1\right ) \, \sqrt {-2 i - 2} + 2 \, \sqrt {x^{2} + x} + 2 i\right ) + \frac {1}{2} \, \sqrt {-2 i - 2} \log \left (-2 \, x + \left (i - 1\right ) \, \sqrt {-2 i - 2} + 2 \, \sqrt {x^{2} + x} + 2 i\right ) + \frac {5}{8} \, \log \left (-2 \, x + 2 \, \sqrt {x^{2} + x} - 1\right ) \]
[In]
[Out]
\[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\int \frac {\left (x \left (x + 1\right )\right )^{\frac {3}{2}}}{x^{2} + 1}\, dx \]
[In]
[Out]
\[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\int { \frac {{\left (x^{2} + x\right )}^{\frac {3}{2}}}{x^{2} + 1} \,d x } \]
[In]
[Out]
Exception generated. \[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\text {Exception raised: TypeError} \]
[In]
[Out]
Timed out. \[ \int \frac {\left (x+x^2\right )^{3/2}}{1+x^2} \, dx=\int \frac {{\left (x^2+x\right )}^{3/2}}{x^2+1} \,d x \]
[In]
[Out]